<template>
  <div>
      vue APP
    <br>
    <br>
    视图操作<br>
    <a-button-group>
      <a-button @click="moveshang">上</a-button>
      <a-button @click="movexia">下</a-button>
      <a-button @click="movezuo">左</a-button>
      <a-button @click="moveyou">右</a-button>
    </a-button-group>

    <br>
    视图操作
    <br>
    <a-button-group>
      <a-button @mousedown="suoxiao" @mouseup="stopzoom">缩小</a-button>
      <a-button @mousedown="fangda" @mouseup="stopzoom">放大</a-button>

      <a-button @mousedown="fangda1" @mouseup="stopzoom">1.0倍</a-button>


    </a-button-group>
    玩家操作
    <player></player>
  </div>
</template>
<script>
// var game from '';
import game from './game';
import player from './vue/player.vue'

export default {
  components:{player},
  methods:{
    moveshang(){
      console.log("moveshang");
      game.camera.y -= 50;
    },
    movexia(){
        game.camera.y += 50;
    },
    movezuo(){
        game.camera.x -= 50;
    },
    moveyou(){
        game.camera.x += 50;
    },
    suoxiao(){
      console.log("sipxoap");
      window.zooming = true;
      window.zoomAmount = -0.01;
    },
    fangda(){
      window.zooming = true;
      window.zoomAmount = 0.01;
    },
    fangda1(){
      game.camera.scale.x = game.camera.scale.y = 1;
    },
    stopzoom(){
       window.zooming = false;
      // window.zoomAmount = ;
    }
  }
}
</script>
<style>

</style>
